package jgl.vajra.management.dialogFragment;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;

import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.LinearLayoutManager;

import java.util.ArrayList;
import java.util.List;

import jgl.vajra.management.R;
import jgl.vajra.management.databinding.DialogFragmentUseRulesBinding;
import jgl.vajra.management.widget.databindingadapter.SingleTypeBindingAdapter;
import jgl.vajra.management.widget.dialogfragment.BaseDialogFragment;

public class UseRulesDialogFragment extends BaseDialogFragment<DialogFragmentUseRulesBinding> {

    @Override
    public void initView(Context context, View rootView, AttributeSet attrs) {
        mBinding.setView(this);
        setStyle(DialogFragment.STYLE_NORMAL, R.style.BottomSheetEdit);

        List<String> list=new ArrayList<>();
        list.add("");
        list.add("");
        list.add("");

        // 不可嵌套滑动
        mBinding.recyclerView.setNestedScrollingEnabled(false);
        // 取消head 的 recycleView的焦点
        mBinding.recyclerView.setFocusableInTouchMode(false);
        //设置布局管理器
        mBinding.recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        SingleTypeBindingAdapter adapter = new SingleTypeBindingAdapter(getContext(), list, R.layout.item_dialog_use_rules);
        mBinding.recyclerView.setAdapter(adapter);
    }

    @Override
    public void initData(Context context) {
    }

    @Override
    public void initEvent(Context context) {

    }


    public int getLayoutRes() {
        return R.layout.dialog_fragment_use_rules;
    }


    @Override
    public int getGravity() {
        return Gravity.CENTER;
    }


    //确定
    public void onDetermine() {

    }

}
